package com.skq.pojo;


import com.skq.anno.State;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import java.time.LocalDateTime;

@Data
@Schema(description = "文章")
public class Article {
    @Schema(description = "主键ID")
    private Integer id;//主键ID

    @NotBlank
    @Pattern(regexp = "^.{1,10}$")
    @Schema(description = "文章标题")
    private String title;//文章标题

    @NotBlank
    @Schema(description = "文章内容")
    private String content;//文章内容

    @NotBlank
    @URL
    @Schema(description = "封面图像")
    private String coverImg;//封面图像

    @NotBlank
    @State
    @Schema(description = "发布状态 已发布|草稿")
    private String state;//发布状态 已发布|草稿

    @NotNull
    @Schema(description = "文章分类id")
    private Integer categoryId;//文章分类id

    @Schema(description = "创建人ID")
    private Integer createUser;//创建人ID

    @Schema(description = "创建时间")
    private LocalDateTime createTime;//创建时间

    @Schema(description = "更新时间")
    private LocalDateTime updateTime;//更新时间
}
